package experiment5;

public class No_3 {
    public static void main(String []args){
        Time time_1=new Time(555550000);

        System.out.println(time_1.getHour()+"小时，"+time_1.getMinute()+"分钟，"+time_1.getMinute()+"秒");
        Time time_2=new Time();
        time_2.setTime(555550000);
        System.out.println(time_1.getHour()+"小时，"+time_1.getMinute()+"分钟，"+time_1.getMinute()+"秒");
    }



}

class Time{
    long hour;
    long minute;
    long second;

    public Time(){
    }

    public Time(long new_hour,long new_minute,long new_second){
        hour=new_hour;
        minute=new_minute;
        second=new_second;
    }

    public Time(long time){
        //转换成秒
        time=time/1000;

        hour=time/3600;
        minute=(time%3600)/60;
        second=(time%3600)%60;
    }

    public long getHour(){
        return hour;
    }

    public long getMinute(){
        return minute;
    }

    public long getSecond(){
        return second;
    }
    
    public void  setTime(long elapseTime){
        //转换成秒
        elapseTime=elapseTime/1000;

        second=elapseTime%60;
        elapseTime=elapseTime/60;

        minute=elapseTime%60;
        elapseTime=elapseTime/60;

        hour=elapseTime;
    }


}
